$(function(){
    $("#loginBtn").click(function(){
        $.post(
            serverBase + "user/admin/login" ,
            //baseUrl + "json/login.json" ,
            $("#loginForm").serialize() ,
            function(req) {
                layer.msg(req.msg) ;
                if(req.errorCode == 0) {
                    loginUrl = req.data.userid ;
                    sessionStorage.setItem("userid" , JSON.stringify(loginUrl)) ;
                    location.href = "../../../../../team1/sys/index2.html" ;
                }
            }
        )
    })
    $("#useradd").click(function (data) {
        $.post(
            serverBase+'/user/admin/add ',
            $("#addForm").serialize()

            // $('#username input[name="username"]').val(),
            //  $('#password input[name="password"]').val(),
            //  $('#email input[name="email"]').val(),
            //  $('#phone input[name="phone"]').val()
            ,
            function(data){
                layer.msg(data.msg)
                if (data.code == 200) {
                    layer.msg(data.msg)
                }
            })

    })
})